<script>
$(function(){
    /* 全选 */
	 $('.checkall').click(function(){
        var _self = this;
        $('.checkitem').each(function(){
            if (!this.disabled)
            {
                $(this).attr('checked', _self.checked);
            }
        });
        $('.checkall').attr('checked', this.checked);
    });
	 
	$('#del').click(function(){
		if($('.checkitem:checked').length == 0){
			return false;
		}
		var url = "main.php?m=sns&s=admin_share_product";
		var items = '';
			$('.checkitem:checked').each(function(){
				items += this.value + ',';
		});
		items = items.substr(0, (items.length - 1));
		$.get(url,'pid=' + items,showResponse);
		function showResponse(originalRequest)
		{
			document.location.reload();
		}
		return false;
	});
});
</script>
<div class="path">
    <div>
    	<a href="main.php?cg_u_type=1">用户中心</a> <span>&gt;</span> 
        收藏商品
    </div>
</div>
<div class="main">
	<div class="wrap">
        <div class="hd">
            <ul class="tabs">
                <li class="active"><a href="main.php?m=sns&s=admin_share_product">收藏商品</a></li>
            </ul>
        </div>
        <table class="table-list-style">
            <tr>
                <td colspan="20" class="pic_model">
                    <ul>
                    <{foreach item=list key=num from=$re.list}>
                    	<li>
                        <dl>
                            <dt>
                           <input type="checkbox" value="<{$list.id}>" class="checkitem" name="chk[]">
                            <a target="_blank" href="<{$config.weburl}>/?m=product&s=detail&id=<{$list.pid}>"><{$list.pname}></a></dt>
                            <dd class="picture">
                                <div><a target="_blank" href="<{$config.weburl}>/?m=product&s=detail&id=<{$list.pid}>"><img width="150" height="150" src="<{if $list.image}><{$list.image}><{else}>image/default/nopic.gif<{/if}>"></a></div>
                                <div class="handle"><a href="main.php?m=sns&s=admin_share_product&type=del&id=<{$list.id}>">删除</a></div>
                            </dd>
                            <dd>价格：<em class="price"><{$list.price}></em> 元</dd>
                        </dl>
                        </li>
                    <{/foreach}>
                    </ul>
                </td>
            </tr>
			<{if !$re.list}>
            <tr>
            	<td colspan="20" class="norecord" style="border-top:none;">
                	<i></i><span>暂无符合条件的数据记录</span>	
                </td>
            </tr>
            <{/if}>
            </tbody>
            <tfoot>
            <tr>
            	<td>
                <input type="checkbox" class="checkall">
                <a id="del" confirm="您确定要删除吗?" class="btn2" href="javascript:void(0);">删除</a>
                <div class="pagination"><{$re.page}></div>
                </td>
            </tr>
            </tfoot>
        </table>
     </div>   
</div>